using System.Runtime.CompilerServices;
using UnityEngine;
using UnityEngine.Events;

public class TutorialsManager
{
	private const string tutorialPanelsPath = "Prefabs/";

	private const string tutorialPanelsPrefix = "UI_Tutorial_";

	public static bool IsTutorialOpen;

	[CompilerGenerated]
	private static UnityAction _003C_003Ef__mg_0024cache0;

	public static bool OpenTutorial(int tutorialId)
	{
		string path = "Prefabs/UI_Tutorial_" + tutorialId;
		GameObject gameObject = Resources.Load<GameObject>(path);
		if (gameObject == null)
		{
			return false;
		}
		GameObject gameObject2 = Object.Instantiate(gameObject);
		TutorialPanel component = gameObject2.GetComponent<TutorialPanel>();
		component.SetOnClickAction(OnTutorialPanelClosed);
		IsTutorialOpen = true;
		return true;
	}

	public static void OnTutorialPanelClosed()
	{
		IsTutorialOpen = false;
		UserPreferences.instance.playerData.tutorialProgress++;
		UserPreferences.instance.Save();
		Object.FindObjectOfType<GameController>().OnTutorialClosed();
	}
}
